<ui:composition template="/layout.xhtml"
				xmlns="http://www.w3.org/1999/xhtml"
				xmlns:ui="http://java.sun.com/jsf/facelets"
				xmlns:h="http://java.sun.com/jsf/html"
				xmlns:f="http://java.sun.com/jsf/core">

	<ui:define name="conteudo">
		
		<h1>Contatos Existentes</h1>
	
			<h:dataTable binding="#{agendaBean.datatable}" value="#{agendaBean.contatos}" var="contato">
			
				<h:column>
					<f:facet name="header">
						<h:outputText value="Nome" />
					</f:facet>
					<h:outputText value="#{contato.nome}" />
				</h:column>
				
				<h:column>
					<f:facet name="header">
						<h:outputText value="Data de Nascimento" />
					</f:facet>
					<h:outputText value="#{contato.dataNascimento}" />
				</h:column>
			
				<h:column>
					<f:facet name="header">
						<h:outputText value="Matrícula" />
					</f:facet>
					<h:outputText value="#{contato.matricula}" >
						<f:convertNumber type="number" pattern="d0" /> 						
					</h:outputText>
				</h:column>
			
				<h:column>
					<f:facet name="header">
						<h:outputText value="Filhos" />
					</f:facet>
					<h:outputText value="#{contato.numeroFilhos}" />
				</h:column>
			
				<h:column>
					<f:facet name="header">
						<h:outputText value="Ações" />
					</f:facet>
					<h:form>
						<h:commandButton value="Remover" action="#{agendaBean.removerContato}" />
					</h:form>
				</h:column>
			
			</h:dataTable>		
		
	</ui:define>
	
</ui:composition>